# -*- coding: utf-8 -*-
# __author__ = 'Yuanjiang Huang'
# yuanjiang.huang@socialcredits.cn

import sys, os
import time
from functools import wraps

def timethis(func):

    @wraps(func)
    def wrapper(*args, **kwargs):
		print 'in wrapper'
		start = time.time()
		result = func(*args, **kwargs)
		end = time.time()
		print(func.__name__, end-start)
		return result
    return wrapper

@timethis
def countdown(n):
	print 'count down'
	while n > 0:
	    n -= 1
	print 'count down done'

if __name__ == "__main__":
	countdown(100000)
	print 'Done'